<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.List" %>   
<%@ page import="java.util.HashMap" %>   
<%@ page import="com.cjx.util.GetData" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>局列表</title>

<style>
#tophead{
text-align:justify;
margin:0 auto;
border:0px solid #000;
width:500px;
height:50px;
line-height:40px;
margin-top: 25px;
text-align:justify;
text-align-last:justify;
} 

table{
	border-collapse: collapse;
	width:500px;
	text-align:center
}
th{
border: 1px solid #666666;
}
td{
border: 1px solid #666666;
}
.returnindex{
width:80px;
background-color:#00BFFF;
}
.add{
width:80px;
background-color:#00BFFF;
}
.total{
width:80px;
background-color:#00BFFF;
}
</style>
</head>
<body>
<div id="tophead">
<input class="add" type="button" value="新增" onclick="javascript:location.href='../WebTest/AddServlet?AC=addGroupForm&roundid='+<%=request.getParameter("roundid")%>" width="50">
&nbsp;
<input class="returnindex" type="button" value="返回首页" onclick="javascript:location.href='../WebTest'" width="50">
&nbsp;
<input class="total" type="button" value="结算" onclick="total();" width="50">

</div>
<table  id=table1  align="center" valign="center">
<thead>
<tr  style='background-color:#00BFFF'>
<td>序号</td>
<td>地主</td>
<td>赢家</td>
<td>叫分</td>
<td>炸弹数</td>
<td>得分</td>
</tr>
</thead>
<tbody>
<%
GetData gd = new GetData();
List<HashMap> lists = gd.getGroupList(request.getParameter("roundid"));
List<HashMap> list_group = gd.getGroup(request.getParameter("roundid"));
if(lists.size()>0){
for(int i=0;i<lists.size();i++){
%>
<tr>
<input id="groupid" type="hidden" value=<%=lists.get(i).get("PK")%>>
<td><%=i+1%></td>
<td><%=lists.get(i).get("LANDLORD")%></td>
<td><%=lists.get(i).get("WINNER")%></td>
<td><%=lists.get(i).get("SCORE")%></td>
<td><%=lists.get(i).get("BOMB")%></td>
<td><%=lists.get(i).get("LANDLORDSCORE")%></td>
</tr>
<%
}
}
%>
<tbody>  
</table>
<input id="listsize" type="hidden" value=<%=list_group.size()%>>	
</body>
<SCRIPT LANGUAGE="JavaScript">
   function total(){ 
	   var listlength = document.getElementById("listsize").value;
	   if(listlength<=0){
		   alert("请先开局！");
	   }else{
		   location.href='../WebTest/AddServlet?AC=total&roundid='+<%=request.getParameter("roundid")%>;
	   }
   }
</SCRIPT>
</html>